import Qt 4.7

Rectangle {
    id: container
    smooth: true
    radius: 8
    color: "khaki"
    border.color: "black"
    border.width: 2
    property int textPointSize: 10

    function show(text) {
        dialogText.text = text;
        container.opacity = 1;
    }

    function hide() {
        container.opacity = 0;
    }

    width: dialogText.width + 20
    height: dialogText.height + 20
    opacity: 0

    Text {
        id: dialogText
        font.pointSize: container.textPointSize
        anchors.centerIn: parent
        text: ""
    }

    MouseArea {
        anchors.fill: parent
        onClicked: hide();
    }
}
